<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
    <style>
        .ivu-upload{
            display: inline-block;
        }
        .model-download{
            display: inline-block;
            height: 31px;
            width: 92px;
            background: green;
            color: white;
            font-size: 20px;
        }

        .ui-jqgrid tr.jqgrow td {
            white-space: normal !important;
            height:auto;
            vertical-align:text-top;
            padding-top:2px;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.exchangeCode" @on-enter="query" placeholder="兑换码"/>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.giftName" @on-enter="query" placeholder="所属类别名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
            </div>
            <div class="buttons-group">
                <i-button type="success" @click="downloadModel"><i class="fa fa-plus"></i>&nbsp;下载模板 </i-button>
                <Upload
                        ref="upload"
                        action="/platform-framework/exchangeCode/import"
                        name="file"
                        :show-upload-list="false"
                        :on-format-error="handleFormatError"
                        :on-success="handleSuccess"
                        :on-error="handleError"
                        :format ="['xlsx','xls']">
                    <i-button type="info" @click="importAll"><i class="fa fa-plus"></i>&nbsp;批量导入</i-button>
                </Upload>


                #if($shiro.hasPermission("adposition:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
<!--                #if($shiro.hasPermission("adposition:update"))-->
<!--                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>-->
<!--                #end-->
                #if($shiro.hasPermission("adposition:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="gift" :rules="ruleValidate" :label-width="80">
<!--            <Form-item label="所属类别名称">-->
<!--                <i-select v-model="goods" filterable multiple>-->
<!--                    <i-option v-for="goods in goodss" :value="goods.id" :key="goods.id">{{goods.name}}</i-option>-->
<!--                </i-select>-->
<!--            </Form-item>-->
            <Form-item label="礼包类型" prop="giftTypeId">
                <i-select v-model="giftTypeId" @on-change="giftTypeChange">
                    <i-option v-for="giftType in giftTypes" :value="giftType.id" :key="giftType.id" >{{giftType.giftName}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="包含礼品" >
                <i-input v-model="gift.giftContain" placeholder="只读类型" type="textarea" readonly/>
            </Form-item>
            <Form-item label="卡号" prop="cardNumber">
                <i-input v-model="gift.cardNumber" placeholder="卡号"/>
            </Form-item>
            <Form-item label="兑换码" prop="exchangeCode">
                <i-input v-model="gift.exchangeCode" placeholder="兑换码"/>
            </Form-item>


<!--            <Form-item label="兑换时间" prop="useStartDate" >-->
<!--                <Date-picker v-model="gift.activityStartDate"  @on-change="handleActivityStartDate" format="yyyy-MM-dd HH:mm:ss" placeholder="兑换开始时间"></Date-picker>  &#45;&#45;-->
<!--                <Date-picker v-model="gift.activityEndDate"  placeholder="兑换结束时间" @on-change="handleActivityEndDate" format="yyyy-MM-dd HH:mm:ss"></Date-picker>-->
<!--            </Form-item>-->

            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">保存</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/shop/cdkey.js?_${date.systemTime}"></script>
</body>
</html>